import request from '@/config/request'
import type { CategoryForm } from '@/config/forms'

export default {
    getList: () => {
        return request.get('/backend/category')
    },
    getItem: (id : number) => {
        return request.get('/backend/category/' + id)
    },
    create: (form: CategoryForm) => {
        return request.post('/backend/category/', form)
    },
    update: (id: number, form: CategoryForm) => {
        return request.post('/backend/category/' + id, form)
    },
    delete: (id: number) => {
        return request.delete('/backend/category/' + id)
    }
}